import React from 'react'
import { Text, View } from '@tarojs/components'
import './index.scss'
interface Props {
  num: number,
  showDot?: boolean,
  container?: string,
  redTextClass?: string,
}
const Index: React.FC<Props> = ({
  num = 0, showDot = false, container, redTextClass
}) => {
  if (!showDot && num <= 0) return null
  return (
    <View
      className={`${showDot ? 'redDotTextContainer' : 'srcUnReadContainer'} ${container} ${!showDot && num > 10 ? 'srcUnReadPadding6' : ''}`}
    >
      {!showDot && <Text className={`unReadText ${redTextClass}`}>{num}</Text>}
    </View>
  )
}

export default Index
